package com.bnlr.lrparking.appui.carport.purpose.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.bnlr.lrparking.R;
import com.bnlr.lrparking.appui.appoint.bean.AppointBean;

import java.util.List;

/**
 * 我的意向 recycle view Adapter
 *
 * Created by Administrator on 2017/12/19 0019.
 */

public class PurposeAdapter extends BaseQuickAdapter<AppointBean.DataBean,BaseViewHolder>{
    public PurposeAdapter(@Nullable List<AppointBean.DataBean> data) {
        super(R.layout.item_purpose_layout,data);
    }

    @Override
    protected void convert(BaseViewHolder holder, AppointBean.DataBean item) {
        ImageView iv = holder.getView(R.id.stall_deal_iv);
        Glide.with(mContext).load(item.getPhotoUrl())
                .placeholder(R.mipmap.tab2_defaultgraph)
                .error(R.mipmap.tab2_defaultgraph)
                .into(iv);
        holder.setText(R.id.item_type,item.getStatus());
        holder.setText(R.id.tv_stalldeal_title,item.getTitle());

        holder.setText(R.id.tv_stalldeal_price,"¥"+item.getPrice());
        holder.setText(R.id.tv_stalldeal_address_deilsa,item.getAddress());
        if (item.getSpaceOwerType()==0){
            holder.setText(R.id.tv_stalldeal_type,"个人");
            holder.setText(R.id.tv_car_number,"平台编号："+item.getNumber());
        }else if (item.getSpaceOwerType()==1){
            holder.setText(R.id.tv_stalldeal_type,"开发商");
            holder.setText(R.id.tv_car_number,"车位编号："+item.getNumber());
        }

    }
}
